package pacBiopackage;

import java.io.BufferedReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.StringTokenizer;

public class PacBioReadIntoContainer 
{
	
	
	public PacBioReadContainer readIntoContainer(BufferedReader br)
	{
		PacBioReadContainer readContainer = new PacBioReadContainer();
		try
		{
			readContainer.setHeader(br.readLine());
			readContainer.setOrginalSequence(br.readLine());
			readContainer.setCorrectedSequence(new StringBuilder(br.readLine()));
			List<Integer> notCorrectedPosition = new ArrayList<Integer>();
			HashMap<Integer, Boolean> visit = new HashMap<Integer, Boolean>();
			StringTokenizer st = new StringTokenizer(br.readLine(),"[] , ");
			while(st.hasMoreTokens())
			{
				String temp = st.nextToken();
				if(temp.equals("[") || temp.equals("]"))
				{
					System.err.print("Tokenizer geht net so");
				}
				else
				{
					notCorrectedPosition.add(Integer.valueOf(temp));
					visit.put(Integer.valueOf(temp),false);
				}
			}
			readContainer.setNotCorrectedPositions(notCorrectedPosition);
			readContainer.setChecked(visit);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
		return readContainer;
	}
	
	
	
	
}
